package com.tea.funct.service.impl;

import com.tea.common.utils.DateUtils;
import com.tea.funct.domain.TeaFixation;
import com.tea.funct.domain.res.FixationConfig;
import com.tea.funct.mapper.TeaFixationMapper;
import com.tea.funct.service.ITeaFixationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 静态配置Service业务层处理
 *
 * @author Sophia
 * @date 2024-06-06
 */
@Service
public class TeaFixationServiceImpl implements ITeaFixationService {
    @Autowired
    private TeaFixationMapper teaFixationMapper;

    /**
     * 查询静态配置
     *
     * @param id 静态配置主键
     * @return 静态配置
     */
    @Override
    public TeaFixation selectTeaFixationById(Long id) {
        return teaFixationMapper.selectTeaFixationById(id);
    }

    /**
     * 查询静态配置列表
     *
     * @param teaFixation 静态配置
     * @return 静态配置
     */
    @Override
    public List<TeaFixation> selectTeaFixationList(TeaFixation teaFixation) {
        return teaFixationMapper.selectTeaFixationList(teaFixation);
    }

    /**
     * 新增静态配置
     *
     * @param teaFixation 静态配置
     * @return 结果
     */
    @Override
    public int insertTeaFixation(TeaFixation teaFixation) {
        teaFixation.setCreateTime(DateUtils.getNowDate());
        return teaFixationMapper.insertTeaFixation(teaFixation);
    }

    /**
     * 修改静态配置
     *
     * @param teaFixation 静态配置
     * @return 结果
     */
    @Override
    public int updateTeaFixation(TeaFixation teaFixation) {
        teaFixation.setUpdateTime(DateUtils.getNowDate());
        return teaFixationMapper.updateTeaFixation(teaFixation);
    }

    /**
     * 批量删除静态配置
     *
     * @param ids 需要删除的静态配置主键
     * @return 结果
     */
    @Override
    public int deleteTeaFixationByIds(Long[] ids) {
        return teaFixationMapper.deleteTeaFixationByIds(ids);
    }

    /**
     * 删除静态配置信息
     *
     * @param id 静态配置主键
     * @return 结果
     */
    @Override
    public int deleteTeaFixationById(Long id) {
        return teaFixationMapper.deleteTeaFixationById(id);
    }

    @Override
    public FixationConfig getConfigInfo() {
        return teaFixationMapper.getConfigInfo();
    }

    @Override
    public TeaFixation selectTeaFixationByFeild(String feildFlag) {
        return teaFixationMapper.selectTeaFixationByFeild(feildFlag);
    }
    
}
